<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "cargo");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>

<c:forEach var="inStock" items="${inStocks}" varStatus="status">
		<div class="panel panel-white">
			<div class="panel-heading">
				<h6 class="panel-title">入库记录</h6>
				<div class="heading-elements">
					<ul class="icons-list">
                		<li><a data-action="collapse"></a></li>      
                		<li>
                			<t:button icon="icon-floppy-disk" onclick="printer('${inStock.inStockId}')" laddaType="progress" cssClass="btn-info" csize="sm">打印</t:button>  
                			<%-- <t:button icon="icon-cancel-square position-left" onclick="toVoid('${inStock.inStockId}')" laddaType="progress" cssClass="btn-info" csize="sm">作废</t:button> --%>       		
						</li>      
                	</ul>
               	</div>
			</div>
			<div class="table-responsive" style="height:400px">
				
				<table class="cntable table table-bordered  " >	
					
					<thead>
						<tr class="success" >
							<th style="width:50px">序号</th>
							<th style="width:120px">商品编码</th>
							<th style="width:120px">商品名称</th>
							<th style="width:120px">规格</th>
							<th style="width:120px">单位</th>
							<th style="width:120px">采购数</th>
							<th style="width:120px">本次入库数</th>
						</tr>
					</thead>
					<tbody >
						<c:forEach var="inStockShow" items="${inStock.inStockShows}" varStatus="status">
							<c:forEach var="inStockcollocation" items="${inStockShow.inStockCollocations}" varStatus="status">
							<tr >
								<td>${status.index+1 }</td>
								<td>${inStockShow.cargo.cargoNo }</td>
								<td>${inStockShow.cargo.cargoName }</td>
								<td>${inStockcollocation.collocation.propertyNameOne }/${inStockcollocation.collocation.propertyNameTwo }</td>
								<td>${inStockShow.cargo.unit }</td>
								<td>${inStockcollocation.purchaseCollocation.purchaseNumber }</td>
													
								<td>
									${inStockcollocation.collocationNum }
								</td>
							</tr>
						</c:forEach>	
						</c:forEach>	
					</tbody>
					<tfoot >
						<tr style="height:20px" >
							<th colspan="8"> </th>
						</tr>
					</tfoot>
				</table>    
				<t:formgroup>
					<label  style="font-size:1.0em;margin-left:20px;">入库单号：${inStock.inStockNo }</label> 	
					<label  style="font-size:1.0em;margin-left:20px">入库仓：${inStock.warehouse }</label> 	
					<label  style="font-size:1.0em;margin-left:20px">经办人：${inStock.createUserName }</label> 
					<label  style="font-size:1.0em;margin-left:20px">入库日期：<fmt:formatDate value="${inStock.createDate}" type="date" dateStyle="default" pattern="YYYY-MM-dd HH:mm"/></label>
					<label  style="font-size:1.0em;margin-left:20px">备注：${inStock.comment }</label>  	
				</t:formgroup>
							
			</div>
		</div>
</c:forEach>

<script type="text/javascript">

function saveData(lBtn){
	if (!$("form:first").valid()){
		return;
	}
	lBtn.start();
	$("form:first").submit();
}	

function toVoid(id){
	
	var url = $.getVirtualPath()+"/purchase/purchase/toVoid?key="+id;
	deleteDataEx(url, searchCallback);

}

function printer(inStockId){


	top.openModal("/purchase/purchase/inStockDetailPrint?key="+inStockId,"inStock_form","采购入库单打印",1200,450);
}
</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
